package org.qiancizhan.Controller;

import org.qiancizhan.Mapper.CollectionMapper;
import org.qiancizhan.Model.DTO.PageConfigDTO;
import org.qiancizhan.Model.POJO.WordPOJO;
import org.qiancizhan.Model.VO.WordsVO;

import java.util.List;

public class CollectionController {
    private final CollectionMapper collectionMapper = new CollectionMapper();

    public boolean addCollection(WordPOJO word){
        return collectionMapper.addCollection(word);
    }

    public WordsVO getUserCollectionWords(PageConfigDTO pageConfigDTO) {
        List<WordPOJO> data = collectionMapper.getUserCollectionWords(pageConfigDTO);
        return new WordsVO(data, pageConfigDTO);
    }


    public int getUserWord_count() {
        return collectionMapper.getUserWord_count();
    }

    public boolean delCollection(int collectionId) {
        return collectionMapper.delCollection(collectionId);
    }

    public boolean clearCollection() {
        return collectionMapper.clearCollection();
    }
}
